<?php

$server = 'localhost';
$username = 'root';
$password = '1336';
$dbname = 'thtp';
mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
ini_set('display_errors', true);
ini_set('error_reporting', E_ALL);
if (isset($_POST['email'])) {
    $query = 'select * from users where login = ' . " ' " . "artemm" . " ' ";
  echo $query;
    $res = mysql_query($query) or die(mysql_error());
    $number = mysql_num_rows($res);
    var_dump($number);
    
    if ($number == 0) {
        echo "free";
    }  else {
        echo "busy";
    }
    echo $number;
}
?>
